package com.frankie.weibo.miweibo.mvp.presenter;

import com.frankie.weibo.miweibo.api.MiCallback;
import com.frankie.weibo.miweibo.api.dao.IStatusDao;
import com.frankie.weibo.miweibo.api.dao.impl.StatusDaoImpl;
import com.frankie.weibo.miweibo.bean.StatusBean;
import com.frankie.weibo.miweibo.mvp.view.IMainView;

import java.util.List;

/**
 * Created by Frankie on 2016/8/16.
 */

public class MainPresenter {

    private IStatusDao statusDao;
    private IMainView iMainView;

    public MainPresenter(IMainView iMainView){
        this.iMainView = iMainView;
        statusDao = new StatusDaoImpl();
    }

    public void getStatuses(){
        statusDao.getStatuses(iMainView.getPageNum(), new MiCallback<List<StatusBean>>() {
            @Override
            public void onSuccess(List<StatusBean> statusBeen) {
                iMainView.refreshList(statusBeen);
            }
        });
    }

}
